let requestUtil = require('@/api/http/request.js');
import {
	payUrl
} from '@/api/http/setting.js'

//车型接口
export const getCartypeListAPI = () => {
	return requestUtil('/iot-device-saas-car/cartype/page', 'get',{current:1,size:100}, '');
}

//保存日志
export const saveLogAPI = (params) => {
	return requestUtil('/iot-device-saas-customer/customer/operate/log/save', 'post',params, '');
}

//查询用户绑定车辆的车型分页列表接口
export const getCarTypePageByUserId = () => {
	return requestUtil('/iot-device-saas-car/cartype/selectCarTypePageByUserId', 'get',{current:1,size:100}, '');
}

//车型详情接口
export const getCartypeDetailAPI = (id) => {
	return requestUtil('/iot-device-saas-car/cartype/detail', 'get',{id:id}, '');
}

//车辆详情接口
export const getCarDetailAPI = (id) => {
	return requestUtil('/iot-device-saas-car/car/detail', 'get',{id:id,fromFlag:2}, '');
}

//车辆分页接口
export const getCarListAPI = () => {
	return requestUtil('/iot-device-saas-car/car/page', 'get',{current:1,size:100,fromFlag:2}, '');
}

//车辆编辑接口
export const editCarAPI = (params) => {
	return requestUtil('/iot-device-saas-car/car/customer-update', 'post',params, '');
}

//车辆解绑
export const removeCarAPI = (ids) => {
	return requestUtil('/iot-device-saas-car/car/unBind', 'post',{ids:ids}, '请求中');
}

//车辆绑定
export const bindCarAPI = (params) => {
	return requestUtil('/iot-device-saas-car/car/bind', 'post',params, '请求中');
}

//根据车架号查询车辆
export const searchByVinAPI = (params) => {
	return requestUtil('/iot-device-saas-car/car/searchByVin', 'post',params, '请求中');
}

//认证车辆
export const verifyCarAPI = (carId) => {
	return requestUtil('/iot-device-saas-car/car/auth/record/auth', 'post',{operatorType:"cmcc-v5",carId:carId}, '请求中');
}

//检查车辆
export const checkCarAPI = (vehicleId) => {
	return requestUtil('/iot-device-saas-customer/customer/vehicle/check/check', 'post',{vehicleId:vehicleId}, '');
}

//检测记录分页列表
export const getCheckCarListAPI = (params) => {
	return requestUtil('/iot-device-saas-customer/customer/vehicle/check/page', 'get',{...params,fromFlag:2}, '');
}

//6.3.车辆检测异常明细接口
export const getCheckCarDetailAPI = (vehicleCheckId) => {
	return requestUtil('/iot-device-saas-customer/customer/vehicle/check/item/page', 'get',{vehicleCheckId:vehicleCheckId}, '');
}

//历史轨迹
export const getSelectCoordinateByDate = (params) => {
	return requestUtil('/iot-cqct-motorcycle/metercardupdata/selectCoordinateByDate', 'get',{meterId:id,...params}, '请求中');
}

//车况启动，故障，围栏
export const getCardatastatisticsAPI = (carId) => {
	return requestUtil('/iot-device-saas-car/cardatastatistics/detail', 'get',{carId:carId}, '');
}

// 
export const getCarpayRecordList = (params) => {
	return requestUtil('/iot-device-saas-car/carpayrecord/page', 'get',{current:1,size:1000,...params}, '');
}

// 12.2.支付获取订单号与实付金额接口
export const getCarpayRecord = (params) => {
	return requestUtil('/iot-device-saas-car/carpayrecord/save', 'post',params, '');
}

//获取支付参数
export const getPreorderAPI = (params) => {
	return requestUtil(payUrl + '/wellpay/orderapi/preorder', 'post', params, '请求中');
}